//
//  BRMergeImageView.m
//  BrezzeSaaS
//
//  Created by IOS on 2021/9/10.
//  Copyright © 2021 Brezze GWG. All rights reserved.
//

#import "BRMergeImageView.h"

@implementation BRMergeImageView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}

- (instancetype)initWithImage:(NSArray *)images
{
    self = [super init];
    if (self) {
        self.backgroundColor = UIColor.clearColor;
        [self setSubImage:images];
    }
    return self;
}

- (void)setSubImage:(NSArray *)images {
    
    for (NSString *imgName in images) {
        
        UIImage *img = [UIImage qmui_imageWithThemeProvider:^UIImage * _Nonnull(__kindof QMUIThemeManager * _Nonnull manager, __kindof NSObject<NSCopying> * _Nullable identifier, __kindof NSObject <QDThemeProtocol>* _Nullable theme) {
            return [UIImageMake(imgName) qmui_imageWithTintColor:theme.themeTintColor];
        }];
        
        UIImageView *image = [[UIImageView alloc] initWithFrame:self.bounds];
        image.image = img;
        [self addSubview:image];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
